﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using LotteryVote.Logic.Web;
using LotteryVote.Entity;
using LotteryVote.Logic;

namespace LotteryVote.Web
{
    /// <summary>
    /// RemoveCommGroup 的摘要说明
    /// </summary>
    public class RemoveCommGroup : BaseHandler
    {
        protected override SystemRole IdentityRole
        {
            get
            {
                return SystemRole.Company;
            }
        }

        public override void Process(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            int groupId;
            if (string.IsNullOrEmpty(context.Request["GroupId"]) || !int.TryParse(context.Request["GroupId"], out groupId))
            {
                context.Response.Write("Faild!");
                return;
            }
            CommisionGroupFacade commGroupFacade = new CommisionGroupFacade();
            commGroupFacade.RemoveCommissionGroup(groupId);
            context.Response.Write("Success!");
        }
    }
}